fix(app): fix trace copy to include user input + add session-level Export trace - #282
Merged
Conversation
- Add optional userText parameter to buildTrace, prepended as 'You: ...' - Add buildSessionTrace for full-session trace export - Fix copyTraceForTurn in message-timeline.tsx to include user input - Thread userText prop through AssistantParts → TurnFooter in session-ui - Add 13 new tests covering userText and buildSessionTrace Closes #278
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add 'Export trace' item to both DropdownMenu and MenuV2 layouts, positioned after Share and before Archive - Desktop: saveFilePickerDialog with content write-through via extended save-file-picker IPC handler (no new bridge channel) - Web/webview: <a download> fallback with Blob URL - Default filename: trace-<session-title-slug>-<date>.md - Add session.exportTrace i18n key - Extend SaveFilePickerOptions with optional content field
jeonghun-jj-lee
marked this pull request as ready for review
September 2, 2026 18:33
The flat slice(start+1).filter(assistant) collected assistant messages from ALL subsequent turns, not just the current one. Use parentID to match only assistant messages belonging to the clicked turn, consistent with session-turn.tsx's assistantMessages memo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the per-turn "Copy trace" button to include the user's input (prefixed with
You:) and adds a session-level "Export trace" menu item to the three-dot menu.Changes
Core:
buildTrace+buildSessionTracebuildTraceto accept an optionaluserTextparameter — when provided and non-empty, prependsYou: <text>before the assistant tracebuildSessionTracethat walks all session messages in order, grouping user→assistant turns withYou:prefixesuserTextproduce identical outputPer-turn copy fix
message-timeline.tsx):copyTraceForTurnnow extracts user text from the user message's parts and passes it tobuildTracemessage-part.tsx): ThreadeduserTextprop throughAssistantParts→TurnFooter→handleCopyTraceSession-level Export trace (WIP)
Tests
build-trace.test.tscoveringuserTextprepend, empty/whitespace handling, backward compat,buildSessionTracewith multiple turns, edge cases (no messages, no assistant response, no text part, synthetic parts, multiple assistant messages per turn)Closes #278